Root Zanli
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
o5t6x7pgljbm
/
public_html
/
admin
/
resources
/
views
/
Admin
/
Admin
/
Filename :
create.blade.php
back
Copy
@extends('Admin.layout.main') @section('content') @section('pagestylesheet') <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.3.0/font/bootstrap-icons.css" /> {{-- <link rel="stylesheet" href="{{ asset('app-assets/vendors/select2/select2.min.css')}}" type="text/css"> <link rel="stylesheet" href="{{ asset('app-assets/vendors/select2/select2-materialize.css')}}" type="text/css"> --}} <style> .row .col.m6 { position: relative; } .password-hideshow{ position: absolute; right: 23px; top: 10px; cursor: pointer; } p.error{ color: red; line-height: 18px; } </style> @stop <div id="main"> <div class="row"> <div class="col s12"> <div class="container"> <div class="section"> <div class="row"> <div class="col s12 m12 l12"> <div id="Form-advance" class="card card card-default scrollspy"> <div class="card-content"> @if(isset($role) && $role == 'ADMIN') <h4 class="card-title">Add Admin</h4> @elseif (isset($role) && $role == 'SCHOOL_ADMIN') <h4 class="card-title">Add School Admin</h4> @endif @if ($message = Session::get('success')) <div class="alert alert-success alert-dismissable alert-style-1 text-success"> <p><i class="zmdi zmdi-check"></i> {{ $message }}</p> </div> @elseif ($message = Session::get('error')) <div class="alert alert-danger alert-dismissable alert-style-1 text-danger"> <p><i class="zmdi zmdi-close"></i> {{ $message }}</p> </div> @endif @if ($errors->any()) <div> <ul> @foreach ($errors->all() as $error) <li class="alert alert-danger alert-dismissable alert-style-1 text-danger"> <i class="zmdi zmdi-block"></i> {{ $error }} </li> @endforeach </ul> </div> @endif <form action="{{ route('school-management.admin.store') }}" method="POST" class="" id="create-admin" enctype="multipart/form-data"> @csrf @if (isset($role)) <input id="role" name="role" type="hidden" value="{{$role}}"> @endif <div class="row"> <div class="input-field col m6 s12"> <input id="name" name="name" type="text"> <label for="name">Name</label> </div> </div> <div class="row"> <div class="input-field col m6 s12"> <input id="email" name="email" type="email"> <label for="email">Email</label> </div> </div> <div class="row"> <div class="input-field col m6 s12"> <input id="password" name="password" type="password" > <i class="bi bi-eye-slash password-hideshow" id="togglePassword"></i> <label for="password">Password</label> </div> </div> <div class="row"> <div class="input-field col m6 s12"> <input id="confirm_password" name="confirm_password" type="password"> <i class="bi bi-eye-slash password-hideshow" id="togglePassword1"></i> <label for="confirm-password">Confirm Password</label> </div> </div> <div class="row"> <div class="input-field col s12"> <button class="btn cyan waves-effect waves-light right" type="submit" name="action">Submit <i class="material-icons right">save</i> </button> </div> </div> </form> {{-- {{form::close()}} --}} </div> </div> </div> </div> </div> </div> </div> </div> </div> @section('pagescript') <script src="{{ asset('app-assets/js/jquery.validate.min.js') }}"></script> <script type="text/javascript"> function string_to_slug(str) { str = str.replace(/^\s+|\s+$/g, ""); // trim str = str.toLowerCase(); // remove accents, swap ñ for n, etc var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; var to = "aaaaeeeeiiiioooouuuunc------"; for (var i = 0, l = from.length; i < l; i++) { str = str.replace(new RegExp(from.charAt(i), "g"), to.charAt(i)); } str = str .replace(/[^a-z0-9 -]/g, "") // remove invalid chars .replace(/\s+/g, "-") // collapse whitespace and replace by - .replace(/-+/g, "-"); // collapse dashes return str; } $('#create-admin').validate({ rules: { name: { required: true, }, email: { required: true, emailfull: true }, password: { required: true }, confirm_password: { required: true, equalTo : "#password" }, }, messages: { name: { required: 'Please enter name', }, email: { required: 'Please enter email', }, password: { required: 'Please enter password', }, confirm_password:{ required: 'Please enter confirm password', }, }, errorElement: "p", errorPlacement: function(error, element) { element.after(error); }, /* submitHandler: function (form) { return false; },*/ highlight: function(element) { $(element).closest('.form-group').addClass('has-error'); }, unhighlight: function(element) { $(element).closest('.form-group').removeClass('has-error'); }, }); jQuery.validator.addMethod("emailfull", function(value, element) { return this.optional(element) || /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i .test(value); }, "Please enter valid email address"); jQuery.validator.addMethod("lettersonlys", function(value, element) { return this.optional(element) || /^[a-zA-Z ]*$/.test(value); }, "Letters only please"); </script> <script> const togglePassword = document.querySelector("#togglePassword"); const password = document.querySelector("#password"); togglePassword.addEventListener("click", function () { // toggle the type attribute const type = password.getAttribute("type") === "password" ? "text" : "password"; password.setAttribute("type", type); // toggle the icon this.classList.toggle("bi-eye"); }); // prevent form submit const form = document.querySelector("form"); form.addEventListener('submit', function (e) { e.preventDefault(); }); </script>{{-- password hide/show --}} <script> const togglePassword1 = document.querySelector("#togglePassword1"); const password1 = document.querySelector("#confirm_password"); togglePassword1.addEventListener("click", function () { // toggle the type attribute const type = password1.getAttribute("type") === "password" ? "text" : "password"; password1.setAttribute("type", type); // toggle the icon this.classList.toggle("bi-eye"); }); // prevent form submit const form1 = document.querySelector("form"); form1.addEventListener('submit', function (e) { e.preventDefault(); }); </script>{{-- confirm_password hide/show --}} @stop @endsection